function xGuid(c) {
  var r = Math.random() * 16 | 0;
  var v = c === 'x' ? r : r & 0x3 | 0x8;
  return v.toString(16);
}

export function generate36() { // 36ch
  // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
  return 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'.replace(/[xy]/g, xGuid);
}
export function generate32() { // 32ch
  return 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'.replace(/[xy]/g, xGuid);
}

export function generate16() { // 16ch
  return 'xxxxxxxxxxxxxxxx'.replace(/[xy]/g, xGuid);
}

export function generate8() { // 32ch
  return 'xxxxxxxx'.replace(/[xy]/g, xGuid);
}
